package com.day14test;

import java.io.BufferedInputStream;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;

public class Test1_InputStream {
	public static void main(String[] args) throws IOException {
		
		BIS();
		FIS();
	}
	public static void BIS() throws IOException {
		
		InputStream in = new BufferedInputStream(new FileInputStream("D:\\iotest"));
		
		int b=0;
		while((b = in.read()) !=-1) {
			System.out.println(b);
			
		}
		in.close();
	}
	public static void FIS() throws IOException {
		
		InputStream in2 = new FileInputStream("D:\\iotest");
		
		int b = 0;
		while((b = in2.read()) !=-1) {
			System.out.println(in2);
			in2.close();
		}
	}
	
}
